package com.uyayo.framework.excelhelper;

import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.Workbook;

/**
 * Excel默认字体类 -可自由扩展其它字体样式类
 * @author hfj
 *
 */
public class ExcelFontDefault extends ExcelFont{

    @Override
    public Font getTitleFont(Workbook workbook) {
        return null;
    }

    @Override
    public Font getHeadersFont(Workbook workbook) {

        Font font = workbook.createFont();

        font.setColor(HSSFColor.HSSFColorPredefined.VIOLET.getIndex());

        font.setFontHeightInPoints((short) 12);

        font.setBold(true);

        return font;
    }

    @Override
    public Font getContentFont(Workbook workbook) {

        Font font = workbook.createFont();
        font.setColor(HSSFColor.HSSFColorPredefined.BLUE.getIndex());
        font.setBold(false);
        return font;
    }

}
